package array;

public class MaxOfHeightWeight {
    static int maxOf(int[] a){
        int max=a[0];
        for (int i = 1; i <a.length ; i++) {
            if (a[i]>a[0])
                max=a[i];
        }
        return max;
    }
    public static void main(String[] args) {
        int[] height=new int[]{
                175,165,185,172
        };
        int[] weight=new int[]{
                45,67,70,80
        };
        System.out.println("最高者的身高："+maxOf(height)+"cm");
        System.out.println("最胖者的体重："+maxOf(weight)+"kg");

    }
}
